﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ActivateUser.ascx.cs" Inherits="admin_webparts_Plug_ins_User2_ActivateUser" %>
<%@ Import Namespace="NTTHAO.Sites.CommonSite" %>
<%@ Import Namespace="NTTHAO.Web.BL.Authentication" %>
<style type="text/css">
    #spCancel1, #spCancel2, #spSave1, #spSave2, #spButton12, #spButton13, #spButton14, #spButton15, #spButton16, #spButton17, #spButton18, #spButton22, #spButton23, #spButton24, #spButton25, #spButton26, #spButton27, #spButton28 {font-size:1.1em; font-weight: bold; }
    #spCancel1 button, #spCancel2 button, #spSave1 button, #spSave2 button, #spButton12 button, #spButton13 button, #spButton14 button, #spButton15 button, #spButton16 button, #spButton17 button, #spButton18 button, #spButton22 button, #spButton23 button, #spButton24 button, #spButton25 button, #spButton26 button, #spButton27 button, #spButton28 button { font-family: Verdana,Arial,Helvetica,sans-serif; font-weight: bold; }
</style>
<div class="tip" style="margin-bottom: 3px;">
    <h2 style="left: 0px; position: relative; padding-top: 0px;">Kích hoạt người dùng</h2>
</div>
<%
if (this._User != null)
{
%>
<form id="aspnetForm" method="post" runat="server">
<div style="padding: 7px 0px 10px; overflow: hidden;">
<%  
    if (_User.StatusID != UserStatus.ACTIVATED && _User.StatusID != UserStatus.BLOCKED)
    {
%>
    <span id="spSave1" class="yui-button yui-link-button"><span class="first-child"><asp:Button ID="btnSave1" runat="server" OnClick="btnSave_Click" Text="Kích hoạt" /></span></span>
    <span id="spCancel1" class="yui-button yui-link-button"><span class="first-child"><a href="javascript: history.back();">Quay lại</a></span></span>
<%
    }
%>
</div>
<%
    if (_User.StatusID == UserStatus.ACTIVATED || _User.StatusID == UserStatus.BLOCKED)
    {
%>
<div  style="border:1px solid #89D; border-collapse: collapse; width: 100%; padding: 5px 0px;">
    <p style="padding: 10px 0px; font-weight: bold; font-size: 1.25em; color: blue; text-align: center;">Tài khoản này <%=_User.StatusID == UserStatus.ACTIVATED ? "đã được kích hoạt." : "đã bị khóa vĩnh viễn, không thể kích hoạt lại được."%></p>
</div>
<%
    }
    else
    {
      %>
<div  style="border:1px solid #89D; border-collapse: collapse; width: 100%; padding: 5px 0px;">
    <asp:CheckBox ID="chkActive" Text="Kích hoạt" runat="server" CssClass="b blue" />
</div>
<%
    }
%>
<div style="padding: 7px 0px 10px; overflow: hidden;">
<%  
    if (_User.StatusID != UserStatus.ACTIVATED && _User.StatusID != UserStatus.BLOCKED)
    {
%>
    <span id="spSave2" class="yui-button yui-link-button"><span class="first-child"><asp:Button ID="btnSave2" runat="server" OnClick="btnSave_Click" Text="Kích hoạt" /></span></span>
    <span id="spCancel2" class="yui-button yui-link-button"><span class="first-child"><a href="javascript: history.back();">Quay lại</a></span></span>
<%
    }
%>
<script type="text/javascript">
    YAHOO.util.Event.onContentReady("spCancel2", function () {
        var spCancel1 = new YAHOO.widget.Button("spCancel1");
        var spCancel2 = new YAHOO.widget.Button("spCancel2");
        var spSave1 = new YAHOO.widget.Button("spSave1");
        var spSave2 = new YAHOO.widget.Button("spSave2");
    });
</script>
</div>
<div class="tip" style="margin-bottom: 3px;">
    <h2 style="left: 0px; position: relative; padding-top: 0px;">Thông tin người dùng</h2>
</div>
<%  
    string userTitle = UserTitle.GetTitle(_User.UserTitle);
    if (userTitle == string.Empty)
    {
        userTitle = "-";
    }
%>
<table border="1" cellpadding="5" cellspacing="0" width="100%" class="grid">
    <tr class="odd">
        <td class="b" width="140px">Email đăng nhập: </td>
        <td><span style="color: Blue; font-weight: bold;"><a href="mailto:<%=_User.Email %>"><%=_User.Email %></a></span></td>
    </tr>
    <tr class="odd">
        <td class="b">Tên liên hệ: </td>
        <td>(<%=userTitle%>)&nbsp;<span style="color: Blue; font-weight: bold;"><a href="?type=page&name=user&action=detail&user=<%=_User.Email %>"><%=_User.FullName %></a></span></td>
    </tr>
    <tr class="odd">
        <td class="b">Địa chỉ: </td>
        <td><%=_User.Address %></td>
    </tr>
    <tr class="odd">
        <td class="b">Điện thoại: </td>
        <td><%=_User.TelePhone %></td>
    </tr>
    <tr class="odd">
        <td class="b">Di động: </td>
        <td><%=_User.MobilePhone %></td>
    </tr>
    <tr class="odd">
        <td class="b">Quốc tịch: </td>
        <td><%=_User.Nationality %></td>
    </tr>
    <tr class="odd">
        <td class="b">Ngày tạo: </td>
        <td><%=_User.JoinDate.ToString("HH:mm dd/MM/yyyy")%></td>
    </tr>
    <tr class="odd">
        <td class="b">Lần đăng nhập cuối: </td>
        <td><%=_User.LastLoginTime.ToString("HH:mm dd/MM/yyyy")%></td>
    </tr>
    <tr class="odd">
        <td class="b">Tình trạng: </td>
        <td><%if (_User.StatusID == UserStatus.ACTIVATED){ 
            %><img style="float: left;" src="resources/images/active.png" /><div style="float: left;color: Blue;margin-top: 1px;">&nbsp;<%=UserStatus.GetStatusName(_User.StatusID) %></div><%
              } else { %><img style="float: left;" src="resources/images/inactive.png" /><div style="float: left;color: Red;margin-top: 1px;">&nbsp;<%=UserStatus.GetStatusName(_User.StatusID) %></div><%
              } %></td>
    </tr>
</table>
</form>
<%} %>
